using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

/// <summary>
/// Summary description for SqlServerArrayListProvider
/// </summary>
public partial class SqlServerProvider
{
     
    public ArrayList GetArrayList( )
    {
        ArrayList arrayList = new ArrayList();
        string[] stringValue = null;
        sqlCommand = new SqlCommand();
        sqlCommand.CommandText = commandText;
        sqlCommand.Connection = sqlConnection;
        sqlCommand.CommandType = commandType;
        if (ParameterCollection!=null)
            AddParameters(sqlCommand);      
        SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
        int cols= sqlDataReader.FieldCount;
        
        while (sqlDataReader.Read())
        {
            stringValue = new string[cols];
            for (int i = 0; i < cols; i++)
            {
                stringValue[i] = Convert.ToString(sqlDataReader[i]);
            }
            arrayList.Add(stringValue);
        }
        sqlDataReader.Close();
        sqlCommand.Dispose();
        return arrayList;
    }
}
